package com.yiqi.liebang.feature.news.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.yiqi.liebang.entity.bo.OrderBo;
import com.yiqi.liebang.entity.bo.PageBo;
import com.yiqi.liebang.entity.bo.VisitorBo;
import com.yiqi.liebang.feature.news.contract.VisitorContract;
import com.yiqi.liebang.feature.news.dependencies.visitor.DaggerVisitorModelComponent;
import com.yiqi.liebang.feature.order.contract.OrderContract;
import com.yiqi.liebang.feature.order.dependencies.order.DaggerOrderModelComponent;
import com.yiqi.liebang.framework.api.ApiLib;
import com.yiqi.liebang.framework.api.HomeApi;
import com.yiqi.liebang.framework.api.UserApi;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;

public class VisitorModel implements VisitorContract.Model {

    @Inject
    UserApi api;


    @Inject
    public VisitorModel() {
        DaggerVisitorModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<List<VisitorBo>> getVisitorList(PageBo pageBo) {
        return api.getVisitorRecord(pageBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

}
